let arr = ['../image/dog.jpg', '../image/dog2.jpg'];
//找到dog按钮
let radio = document.getElementById('dog');
function show() {
    let radio = document.getElementById('dog');
    radio.onchange = function () {
        let pic = document.getElementsByClassName('pic-wrap')[0];
        let picChange = pic.firstElementChild;
        let text = picChange.nextElementSibling;

        console.log(picChange);
        let flag = radio.checked;
        if (flag) {
            picChange.src = arr[0];
            pic.style.display = 'block';
            text.innerHTML = '我和狗狗的十个约定'
        }

    }
}
show()
console.log(radio.checked);

function showT() {
    let radioTwo = document.getElementById('hui');
    radioTwo.onchange = function () {
        let pic = document.getElementsByClassName('pic-wrap')[0];
        let picChange = pic.firstElementChild;
        let text = picChange.nextElementSibling;
        let flag = radioTwo.checked;
        if (flag) {
            picChange.src = arr[1];
            pic.style.display = 'block';
            text.innerHTML = '灰霾来了怎么办'
        }

    }
}
showT()